package com.qingcheng.dao;

import com.qingcheng.pojo.system.Resource;
import com.qingcheng.pojo.system.Role;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

public interface RoleMapper extends Mapper<Role> {

    @Select("SELECT id,res_name resName FROM tb_resource WHERE id IN( " +
            "SELECT resource_id FROM tb_role_resource WHERE role_id=#{roleId} ) ")
    public List<Resource> findResourceByRoleId(@Param("roleId") Integer roleId);
}
